package com.peaksport.framework.extend.kafka;

import java.util.Map;

import org.apache.kafka.common.serialization.Serializer;

import com.peaksport.framework.util.PKJSONUtils;
import com.peaksport.framework.vo.JSONKafkaMsg;

public class PKJSONKafkaMsgSerializer implements Serializer<JSONKafkaMsg> {

	@Override
	public void configure(Map<String, ?> configs, boolean isKey) {
		
	}

	@Override
	public byte[] serialize(String topic, JSONKafkaMsg data) {
		return PKJSONUtils.toJSON(data,true).getBytes();
	}

	@Override
	public void close() {}

}
